const express = require('express');
const router = express.Router();
const UserController = require('../controller/UserController');
const pool = require('../database/db');

// 初始化控制器
const userController = new UserController(pool);

// 用户注册路由
router.post("/reg", (req, res) => userController.register(req, res));

// 用户登录路由
router.post("/login", (req, res) => userController.login(req, res));

module.exports = router;